﻿using Newtonsoft.Json;
using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace PlatformNetCore.Entity
{
    [Table("SysUser")]
    public class SysUser
    {
        /// <summary>
        /// ID
        /// </summary>
        [Key]
        [MaxLength(50)]
        public string ID { get; set; }
        [MaxLength(20)]
        [Required(AllowEmptyStrings = false, ErrorMessage = "姓名不能为空")]
        public string Name { get; set; }

        [MaxLength(50)]
        [Required(AllowEmptyStrings = false, ErrorMessage = "登录名不能为空")]
        public string Login { get; set; }
        [MaxLength(200)]
        public string Pwd { get; set; }
        [DefaultValue(1)]
        public int IsAvailable { get; set; }
        [DefaultValue(0)]
        public int IsDel { get; set; }
        [MaxLength(128)]
        public string AddBy { get; set; }
        public Nullable<System.DateTime> AddDate { get; set; }
        [MaxLength(128)]
        public string UpdateBy { get; set; }
        public Nullable<System.DateTime> UpdateDate { get; set; }
        /// <summary>
        /// 角色ID
        /// </summary>
        [MaxLength(36)]
        public string RoleId { get; set; }

        #region 关联
        [ForeignKey("RoleId")]
        public virtual SysRole SysRole { get; set; }
        #endregion
    }
}
